﻿<base:UserControlBase x:Class="WPFDBBrowser.UserControls.QueryEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:base="clr-namespace:WPFDBBrowser.Framework"
             xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
             mc:Ignorable="d" 
             xmlns:l="clr-namespace:WPFDBBrowser.UserControls"
             x:TypeArguments="l:QueryEditorPresenter, l:IQueryEditor"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <ToolBarTray Grid.Row="0"
                     Height="Auto" 
                     x:Name="toolBarTrayMain"
                     HorizontalAlignment="Stretch" 
                     VerticalAlignment="Top">
            
            <ToolBar x:Name="toolBarQueryEditor" 
                     IsTabStop="False" 
                     Band="1" 
                     BandIndex="1">
                
                <Button x:Name="buttonNewQuery"
                        ToolTip="New Query">
                    <Image Source="/WPFDBBrowser;component/Images/script.png" ImageFailed="Image_ImageFailed">                        
                    </Image>
                </Button>
                
                <Button x:Name="buttonLoadQuery"
                        ToolTip="Load query">
                    <Image Source="/WPFDBBrowser;component/Images/server_edit.png">                        
                    </Image>
                </Button>
                
                <Button x:Name="buttonSaveQuery"
                        ToolTip="Save query">
                    <Image Source="/WPFDBBrowser;component/Images/server_delete.png">                        
                    </Image>
                </Button>
                
                <Separator/>
                
                <Button x:Name="buttonExecuteQuery"
                        ToolTip="Execute query">
                    <Image Source="/WPFDBBrowser;component/Images/run.ico">                        
                    </Image>
                </Button>
                
            </ToolBar>
        </ToolBarTray>

        <avalonEdit:TextEditor Grid.Row="1"
                               HorizontalAlignment="Stretch"
                               VerticalAlignment="Stretch"
                               x:Name="aedQueryEditor" 
                               ShowLineNumbers="True"/>
    </Grid>
</base:UserControlBase>
